import request from '@/utils/request'

// 获取工单类型
export const getAllWorkOrderApi = () => request({
  url: '/api/task-service/taskType/list'
})

// 获取工单详情
export const getWorkOrderInfoApi = (taskId) => request({
  url: `/api/task-service/task/taskInfo/${taskId}`
})

// 获取工单信息
export const getWorkOrderSearchApi = (params) => request({
  url: '/api/task-service/task/search',
  params
})
// 根据售货机获取运营人员列表
export const getDialogueInfoApi = (id) => request({
  url: `/api/user-service/user/operatorList/${id}`
})
// 获取售货机货道详情
export const getVendingMachineDetailsApi = (id) => request({
  url: `/api/vm-service/channel/channelList/${id}`
})
// 创建工单
export const createATicketApi = (data) => request({
  url: '/api/task-service/task/create',
  method: 'POST',
  data
})

// 获取补货预警值
export const getReplenishmentCordon = () => request({
  url: '/api/task-service/task/supplyAlertValue'
})

// 设置自动补货工单阈值
export const setReplenishmentThreshold = (alertValue) => request({
  url: '/api/task-service/task/autoSupplyConfig',
  method: 'POST',
  data: {
    alertValue
  }
})

// 获取工单详情
export const getTicketDetails = taskId => request({
  url: `/api/task-service/task/taskInfo/${taskId}`
})

// 工单状态列表
export const getAListOfTicketStatuses = () => request({
  url: '/api/task-service/task/allTaskStatus'
})

// 点击补货详情获取补货信息
export const getReplenishmentDetails = id => request({
  url: `/api/task-service/taskDetails/${id}`
})
